<?php


namespace app\admin\model;


use think\Db;
use think\Model;

class AgentOrder extends Model
{

    public static function getAgentOrder($field='*',$where=[],$limit=10){
        return self::where($where)
            ->field($field)
            ->order('id','desc')
            ->paginate($limit,[]);
    }

    public static function getInfo($id,$field='*')
    {
        return self::where('id',$id)->find();
    }

    public function  getParentId($user_id)
    {
       return Db::name('users')
           ->where('id',$user_id)
           ->field('parent_id,telephone,true_name,user_job_id,agent_grade')->find();
    }
    public function getListJob($user_id){
        return Db::name('agent_job')->where('user_id',$user_id)->select();
    }

}